import 'package:fate_blind_box/routes/page_route_names.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'state.dart';

class FriendProfileLogic extends GetxController {
  final FriendProfileState state = FriendProfileState();

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    state.scrollController.addListener(() {
      if(state.scrollController.position.pixels>=kToolbarHeight){
        state.clarity.value = 1.0;
      }else{
        state.clarity.value = state.scrollController.position.pixels/kToolbarHeight;
      }
    });
  }

  @override
  void onClose() {
    // TODO: implement onClose
    super.onClose();
    state.scrollController.dispose();
  }

  void addMember(){
    Get.toNamed(PageRouteNames.applyAddFriendPage);
  }

  toRemake(){
    Get.toNamed(PageRouteNames.friendSetRemake,);
  }
}
